Skip to content

Add dns resolution logs and handle error correctly#1287

Merged
dobrac merged 4 commits into
mainfrom
add-dns-resolution-logs
Oct 2, 2025
Merged

Add dns resolution logs and handle error correctly#1287
dobrac merged 4 commits into
mainfrom
add-dns-resolution-logs

Conversation

@dobrac
Copy link
Copy Markdown
Contributor

@dobrac dobrac commented Oct 2, 2025

Add dns resolution logs, handle error correctly


Note

Improve DNS resolution error handling and switch to structured logging with sandbox IDs for DNS and not-found cases.

  • Client Proxy (packages/client-proxy/internal/proxy/proxy.go):
    • DNS resolution: Switch warn logs to structured logging with logger.WithSandboxID(sandboxId); propagate underlying DNS error (fmt.Errorf("failed to resolve sandbox: %w")) instead of returning ErrNodeNotFound on final failure.
  • Shared Proxy (packages/shared/pkg/proxy/handler.go):
    • Not-found handling: Include logger.WithSandboxID(notFoundErr.SandboxId) in warn and error logs; minor import added for logger.

Written by Cursor Bugbot for commit 0d6792a. This will update automatically on new commits. Configure here.

@dobrac dobrac added bug Something isn't working improvement Improvement for current functionality labels Oct 2, 2025
// there's no answer, we can't proxy the request
if err != nil {
return "", ErrNodeNotFound
return "", fmt.Errorf("failed to resolve sandbox: %w", err)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be fatal error, not just node not found

@dobrac dobrac marked this pull request as ready for review October 2, 2025 09:33
cursor[bot]

This comment was marked as outdated.

Comment thread packages/client-proxy/internal/proxy/proxy.go Outdated
@dobrac dobrac requested a review from jakubno October 2, 2025 09:50
// there's no answer, we can't proxy the request
if err != nil {
return "", ErrNodeNotFound
return "", fmt.Errorf("failed to resolve sandbox: %w", err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: DNS Query Fails Silently, Causing Invalid Proxying

When DNS queries return no answers but no DNS error, the err variable remains nil after retries. This causes the function to return an empty node string with a nil error, incorrectly signaling success. Downstream code may then attempt to proxy to an invalid empty IP.

Fix in Cursor Fix in Web

@dobrac dobrac merged commit 5610e58 into main Oct 2, 2025
26 checks passed
@dobrac dobrac deleted the add-dns-resolution-logs branch October 2, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working improvement Improvement for current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants